package com.iwuyc.tools.commons.util.image.bo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Objects;

/**
 * 图片基本信息
 */
@Getter
@Setter
@ToString
public class ImageInfo implements Serializable {
    /**
     * 宽度
     */
    private int width;
    /**
     * 高度
     */
    private int height;

    /**
     * 图片类型(小写),gif,png,jpeg,bmp,wbmp
     */
    private String type;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ImageInfo imageInfo = (ImageInfo) o;
        return width == imageInfo.width && height == imageInfo.height && Objects.equals(type, imageInfo.type);
    }

    @Override
    public int hashCode() {
        return Objects.hash(width, height, type);
    }
}
